#ifndef HDDDATA_H
#define HDDDATA_H

#include <vector>
#include "database.h"

#include <dirent.h>

using namespace std;

namespace client_server{
	class HDDdata: public Database{
	public:
		HDDdata();
		~HDDdata();
    
		//neccesary functions for newsgroups
		vector<pair<int, string> > listAllNewsGroups(); 
		void createNewsGroup(const string& name) throw (NewsGroupDoesNotExistException); 
		void deleteNewsGroup(unsigned int id) throw (NewsGroupDoesNotExistException);
		
		//functions for articles
		vector<pair<int,string> > listAllArticles(unsigned int id) throw (NewsGroupDoesNotExistException);
		void readArticle(unsigned int ngId, unsigned int aId, stringstream& ss) throw (NewsGroupDoesNotExistException, ArticleDoesNotExistException);
		void createArticle(unsigned int id,const string& content,const string& author=string("unknown"), const string& artName=string("article")) throw (NewsGroupDoesNotExistException);
		void deleteArticle(unsigned int ngId, unsigned int aId) throw (NewsGroupDoesNotExistException, ArticleDoesNotExistException);

		
		enum File_Directory {FOLDER, FILE};
		enum Mode {ID, NAME, AUTHOR};

	private:
    	DIR* dirp;
		unsigned char isFile;
		unsigned char isFolder;
	};
}
#endif 
